Retrieving Files
Introduction
The REST API endpoint GET /api/v2/document/{id}/file may be used to retrieve a file using the GUID of the file.
The GUID of the file may already be known, or it may have been obtained via the document metadata search API GET /api/v2/document by filtering results for a parent entity, as described in the Assetic Knowledge Base article Document Metadata Search.
Alternatively, the document GUID may have been obtained as part of a larger overall process, such as exporting the Document GUIDs in bulk using an Advanced Search profile targeting the Documents module, including the information that identifies an entity that the Document is linked to (e.g. Asset, Work Request, Work Order, etc.)
Sample Request
https://XXX.assetic.net/api/v2/document/b6b99863-2a29-e611-9459-06edd62954d7/file
Response
File content
The response body is the document content, which may be saved as a file.
File Name
The response headers include the header "Content-Disposition". This contains the filename of the document. The content of this particular header is formatted as "attachment; filename=xxx.txt" where "xxx.txt" is the name of the file.
Script Sample
For an example on a scripted process for the retrieval of files from the Assetic cloud system via REST API requests, refer to the Retrieving Documents article found within the Integration SDKs section of the Assetic Technical Resources.
